<!-- Add fancyBox main JS and CSS files -->
	<script type="text/javascript" src="../source/jquery.fancybox.js?v=2.1.5"></script>
	<link rel="stylesheet" type="text/css" href="../source/jquery.fancybox.css?v=2.1.5" media="screen" />
	
	
	
	
<script type="text/javascript">

$j(document).ready(function() {
		/*
		 *  Simple image gallery. Uses default settings
		 */

		$j('.fancybox').fancybox();

		/*
		 *  Different effects
		 */

		// Change title type, overlay closing speed
		$j(".fancybox-effects-a").fancybox({
			helpers: {
				title : {
					type : 'outside'
				},
				overlay : {
					speedOut : 0
				}
			}
		});

		// Disable opening and closing animations, change title type
		$j(".fancybox-effects-b").fancybox({
			openEffect  : 'none',
			closeEffect	: 'none',

			helpers : {
				title : {
					type : 'over'
				}
			}
		});

		// Set custom style, close if clicked, change title type and overlay color
		$j(".fancybox-effects-c").fancybox({
			wrapCSS    : 'fancybox-custom',
			closeClick : true,

			openEffect : 'none',

			helpers : {
				title : {
					type : 'inside'
				},
				overlay : {
					css : {
						'background' : 'rgba(238,238,238,0.85)'
					}
				}
			}
		});

		// Remove padding, set opening and closing animations, close if clicked and disable overlay
		$j(".fancybox-effects-d").fancybox({
			padding: 0,

			openEffect : 'elastic',
			openSpeed  : 150,

			closeEffect : 'elastic',
			closeSpeed  : 150,

			closeClick : true,

			helpers : {
				overlay : null
			}
		});

		/*
		 *  Button helper. Disable animations, hide close button, change title type and content
		 */

		$j('.fancybox-buttons').fancybox({
			openEffect  : 'none',
			closeEffect : 'none',

			prevEffect : 'none',
			nextEffect : 'none',

			closeBtn  : false,

			helpers : {
				title : {
					type : 'inside'
				},
				buttons	: {}
			},

			afterLoad : function() {
				this.title = 'Image ' + (this.index + 1) + ' of ' + this.group.length + (this.title ? ' - ' + this.title : '');
			}
		});


		/*
		 *  Thumbnail helper. Disable animations, hide close button, arrows and slide to next gallery item if clicked
		 */

		$j('.fancybox-thumbs').fancybox({
			prevEffect : 'none',
			nextEffect : 'none',

			closeBtn  : false,
			arrows    : false,
			nextClick : true,

			helpers : {
				thumbs : {
					width  : 50,
					height : 50
				}
			}
		});

		/*
		 *  Media helper. Group items, disable animations, hide arrows, enable media and button helpers.
		*/
		$j('.fancybox-media')
			.attr('rel', 'media-gallery')
			.fancybox({
				openEffect : 'none',
				closeEffect : 'none',
				prevEffect : 'none',
				nextEffect : 'none',

				arrows : false,
				helpers : {
					media : {},
					buttons : {}
				}
			});

		/*
		 *  Open manually
		 */

		$j("#fancybox-manual-a").click(function() {
			$j.fancybox.open('1_b.jpg');
		});

		$j("#fancybox-manual-b").click(function() {
			$j.fancybox.open({
				href : 'iframe.html',
				type : 'iframe',
				padding : 5
			});
		});

		$j("#fancybox-manual-c").click(function() {
			$j.fancybox.open([
				{
					href : '1_b.jpg',
					title : 'My title'
				}, {
					href : '2_b.jpg',
					title : '2nd title'
				}, {
					href : '3_b.jpg'
				}
			], {
				helpers : {
					thumbs : {
						width: 75,
						height: 50
					}
				}
			});
		});


	});


</script>

<?php 
	include($_SERVER['DOCUMENT_ROOT']."/eventos/sistema/common/login/seguranca.php"); // Inclui o arquivo com o sistema de segurança
	//protegePagina(); // Chama a função que protege a página
	//error_reporting(0);


	//Consulta no banco de dados
	$galeria = "SELECT * 
				FROM tblFoto
				WHERE idUsuario = '4'
				AND   bolPerfil = 0
				ORDER BY idFoto DESC
				LIMIT 0,30 "; 
	$galeria = mysql_query($galeria) or die("Erro no SQL: ".mysql_error());
	
	
	while ($array_galeria = mysql_fetch_array($galeria)) {
	
		/*echo '<div style="border: solid 2px; width: 200px; height:250px; float:left;margin: 10px 0px 10px 85px;">' .
					'<img src="/eventos/uploads/' . $array_galeria[idUsuario] . '/' . $array_galeria[strCaminho] . '"' . 'width="200" height="250" />' .
			  '</div>';
		*/
		echo 
			'<div style="border: solid 2px; width: 200px; height:250px; float:left;margin: 10px 0px 10px 85px;">' .
			'<a class="fancybox" href="/eventos/uploads/' . $array_galeria[idUsuario] . '/' . $array_galeria[strCaminho] . '"' . 'data-fancybox-group="gallery" title="Lorem ipsum dolor sit amet">' .		
				'<img src="/eventos/uploads/' . $array_galeria[idUsuario] . '/' . $array_galeria[strCaminho] . '"' . 'width="200" height="250" />' . 
			'</a>' .
			'</div>';
		echo '<a href="/eventos/uploads/' . $array_galeria[idUsuario] . '/' . $array_galeria[strCaminho] . '"' . 'class="lytebox" data-title="My Title">Image #1</a>'; 
	}

?>

<a href="images/image-1.jpg" class="lytebox" data-title="My Title">Image #1</a>





